package com.max.common.util;


import org.mortbay.jetty.Connector;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.nio.SelectChannelConnector;
import org.mortbay.jetty.webapp.WebAppContext;

/**
 * 
 * 项目名称:max-project-graphics
 * 文件名称:Jetty.java
 * 文件描述:
 * 创建人员:chenyibo
 * 创建时间:2013-1-16 下午02:45:59
 * 修改人员:chenyibo
 * 修改时间:2013-1-16 下午02:45:59
 * 修改备注:
 * @version V1.0
 */
public class Jetty 
{
	public static void main(String[] args) throws Exception 
	{  
	    Server server = new Server();
//	    BoundedThreadPool threadPool = new BoundedThreadPool();
//	    threadPool.setMaxThreads(100);
//	    server.setThreadPool(threadPool);
	    Connector connector = new SelectChannelConnector();
	    connector.setPort(7080);
	    server.setConnectors(new Connector[] {connector});
	    WebAppContext context = new WebAppContext("src/main/webapp", "/max-project-graphics");
	    server.addHandler(context);
	    server.setStopAtShutdown(true);
	    server.setSendServerVersion(true);
	    server.start();
	    server.join();
	}  
}
